using System;
using System.Collections.Generic;
using OrderManager.Domain.Entities;

namespace OrderManager.Domain.Repositories
{
    /// <summary>
    /// Defines generalized type-specific methods that some type implements to manipulate repository entities
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IRepositoryBase<T> where T : EntityBase
    {
        /// <summary>
        /// Delete an entity with specified id
        /// </summary>
        /// <param name="id">Id of entity to delete</param>
        void Delete(Int32 id);

        /// <summary>
        /// Get all entities from repository
        /// </summary>
        /// <returns>Collection of instances of specified type</returns>
        List<T> GetAll();

        /// <summary>
        /// Get entities with specified id from repository
        /// </summary>
        /// <param name="id">Id of entity to get</param>
        /// <returns></returns>
        T GetById(Int32 id);

        /// <summary>
        /// Updates entity in repository with properties values of specified instance
        /// </summary>
        /// <param name="entity">An instance of specified type</param>
        void Update(T entity);
    }
}